# -*- coding: utf-8 -*-
# filename: available.py
import json
from lottery.view import mysql_util


def get_avai():
        try:
            conn = mysql_util.getconn()
            conn.execute("select mobile from sign where prize_level='-1'")
            pdata = []
            for person in conn.fetchall():
                pdata.append(person[0])
            conn.close()
            datadict = dict()
            datadict['data'] = pdata
            datadict['result'] = True
            return json.dumps(datadict)
        except Exception as e:
            return e.args
